export function useTable(vm: any) {
    console.log(vm)

    // 订单记录
    const column: any = [
        { title: '序号', type: 'seq', width: 50 },
        { field: 'orderNo', title: '订单号', width: 90 },
        { field: 'merchantName', title: '商户名称', width: 90 },
        { field: 'productName', title: '产品名称', width: 90 },
        { field: 'orderSource', title: '订单来源', width: 90 },
        { field: 'orderChannel', title: '订单渠道', width: 90 },
        { field: 'orderStatus', title: '订单状态', width: 90 },
        { field: 'orderAmount', title: '订单金额', width: 90 },
        { field: 'preferentialConditions', title: '优惠条件', width: 90 },
        { field: 'actualAmountPaid', title: '实付金额', width: 90 },
        { field: 'pointsConsumption', title: '消耗积分', width: 90 },
        { field: 'orderTime', title: '下单时间', width: 150 },
        { field: 'paymentTime', title: '支付时间', width: 150 },
        { field: 'paymentWay', title: '支付渠道', width: 90 },
        { fixed: true, slots: { default: 'operate' }, title: '操作' },
    ]
    const integral: any = [
        { title: '序号', type: 'seq', width: 50 },
        { field: 'operationDateTime', title: '操作时间' },
        { field: 'valueBeforeOperation', title: '操作前数值' },
        { slots: { default: 'textColor' }, title: '积分数值' },
        { field: 'valueAfterOperation', title: '操作后积分' },
        { field: 'reason', title: '积分原因' },
        { field: 'remark', title: '备注' },
    ]
    const grow: any = [
        { title: '序号', type: 'seq', width: 50 },
        { field: 'operationDateTime', title: '操作时间' },
        { field: 'valueBeforeOperation', title: '操作前成长值' },
        { field: 'pointsValue', slots: { default: 'textColor' }, title: '成长值数值' },
        { field: 'valueAfterOperation', title: '操作后成长值' },
        { field: 'reason', title: '成长值原因' },
        { field: 'remark', title: '备注' },
    ]
    const Coupon: any = [
        { title: '序号', type: 'seq', width: 50 },
        { field: 'receiveTime', title: '操作时间' },
        { field: 'couponName', title: '优惠券名称' },
        { field: 'parValue', slots: { default: 'textColor' }, title: '面值（元）' },
        { field: 'couponType', title: '优惠类型' },
        { field: 'useStatus', slots: { default: 'useStatus' }, title: '使用状态' },
        { field: 'remark', title: '操作备注' },
        { fixed: true, slots: { default: 'operate' }, title: '操作', width: 300 },
    ]
    const contract: any = [
        { title: '序号', type: 'seq', width: 50 },
        { field: 'signingDateTime', title: '签订时间' },
        { field: 'contractName', title: '合同名称' },
        { field: 'contractAmount', slots: { default: 'textColor' }, title: '合同金额（元）' },
        { field: 'signingCode', title: '签约编码' },
        { field: 'contractStatus', title: '合同状态' },
        { field: 'remark', title: '备注' },
        { fixed: true, slots: { default: 'operate' }, title: '操作', width: 300 },
    ]
    const gridOptions = {
        border: true,
        columnConfig: {
            resizable: true,
        },
        columns: [],
        data: [],
        editConfig: {
            mode: 'row',
            showStatus: true,
            trigger: 'manual',
        },
        height: 300,
        keepSource: true,
        loading: false,
        pagerConfig: {
            currentPage: 1,
            enabled: true,
            pageSize: 10,
            pageSizes: [10, 20, 50, 100, 200, 500],
            total: 0,
        },
        showOverflow: true,
    }

    return {
        column: [
            column,
            integral,
            grow,
            Coupon,
            contract,
        ],
        gridOptions,
    }
}
